// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'
import file from "@/utils/file";
export function photoList(params) {
  //此处直接使用参数
  const _params = {
    keyWord:params.keyWord,
    status:params.status,
    selectCrtTime:params.selectCrtTime.join(','),
    selectDepId:params.selectDepId,
    questionType:params.questionType,
    page:params.page,
    limit:params.limit,
    isOverdue:params.isOverdue
  }
  return request({
    url: '/getBehindFormList',
    method: 'GET',
    params:_params
  })
}
export function superviseList(params) {
  //此处直接使用参数
  const _params = {
    keyWord:params.keyWord,
    status:params.status,
    selectCrtTime:params.selectCrtTime.join(','),
    selectDepId:params.selectDepId,
    questionType:params.questionType,
    page:params.page,
    limit:params.limit,
    isOverdue:params.isOverdue
  }
  return request({
    url: '/getSuperintendList',
    method: 'GET',
    params:_params
  })
}
export function comList(params) {
  //此处直接使用参数
  return request({
    url: '/dep/getDepList',
    method: 'GET',
    params
  })
}
export function comAdd(data) {
  return request({
    url: '/dep/insertDep',
    method: 'POST',
    data: data
  })
}
// 状态
export function getFormStatus() {
  return request({
    url: '/getFormStatus',
    method: 'GET'
  })
}
// 修改随手拍
export function updateForm(data) {
  return request({
    url: '/updateForm',
    method: 'get',
    params: data
  })
}
export function getFormById(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/getBehindFormById',
    method: 'GET',
    params : data
  })
}
export function getFormRemarkById(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/selectHandle',
    method: 'GET',
    params : data
  })
}
export function getFormAppealById(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/selectAppeal',
    method: 'GET',
    params : data
  })
}

export function comDel(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/deleteForm',
    method: 'GET',
    params : data
  })
}
export function depDel(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/dep/deleteDep',
    method: 'GET',
    params : data
  })
}

export function updateFormRemark(data) {
  // data.rules = pram.rules.join(',')
  return request({
    url: '/insertHandle',
    method: 'post',
    data
  })
}

export function updateFormAppeal(data) {
  // data.rules = pram.rules.join(',')
  return request({
    url: '/insertAppeal',
    method: 'post',
    data
  })
}
export function exportExcelApi(data) {
  return file({
    url: '/exportExcel',
    method: 'post',
    data
  })
}
